import org.junit.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.ww.config.MainConfigAutowired;
import org.ww.dao.BookDao;
import org.ww.service.BookService;

public class IOTestAutowired {

    AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(MainConfigAutowired.class);
    @Test
    public void test01(){
        BookService bookService= applicationContext.getBean(BookService.class);
        System.out.println(bookService);

        BookDao bookDao = applicationContext.getBean("bookDao",BookDao.class);
        System.out.println(bookDao);

    }
}
